"""需要配置的东西"""
import os

"""各个文件的路径地址"""
dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DATADIR = os.path.join(dir, 'data')
RESULTDIR = os.path.join(dir, 'result')
LOGDIR = os.path.join(RESULTDIR, 'log')
REPORTDIR = os.path.join(RESULTDIR, 'report')
SCREENSHOTDIR = os.path.join(RESULTDIR, 'screenshot')
CASEDIR = os.path.join(dir, 'testcases')

"""环境地址"""
host_url = "https://www.ketangpai.com"

"""浏览器驱动"""
deriver_type = "chrome"  # chrome/ie/firefox

"""邮件配置"""
email = {
    "host": "smtp.126.com",
    "port": 465,
    "user": "yywonne",
    "pwd": "09Yang09jia09yu",
    "from_addr": "yywonne@126.com",
    "to_addrs": "769765296@qq.com",
}

# *************************************************Excel 中需定义好的数据************************************************
"""Excel首行名称"""
excel_title = ['id', 'keyword', 'type', 'locator', 'index', 'input', 'check']

""" keyword列固定的值，需要添加时往这里面添加，对应网页操作的方法（selenium基类的封装方法）"""
function_dic = {
    "打开网页": "get_url",
    "关闭浏览器": "close_browser",
    "等待": "go_to_sleep",
    "等待元素可点击": "wait_clickable_element",
    "等待元素可见": "wait_visible_element",
    "等待元素不可点击": "wait_non_clickable_element",
    "等待元素不可见": "wait_invisible_element",
    "输入": "input",
    "清空输入框": "is_clear",
    "点击": "click",
    "双击": "double_click",
    "右击": "context_click",
    "鼠标悬浮": "move_to_element",
    "鼠标拖拽": "drag_and_drop",
    "下拉选择": "selector",
    "上传文件": "upload_file",
    "执行脚本": "execute_script",
    "滚动到窗口底部": "scroll_to_window_bottom",
    "iframe窗口切换": "switch_to_iframe_window",
    "切换浏览器窗口": "switch_window",
    "alert窗口切换": "switch_to_alert_window",
    "检查元素可见": "",
    "检查元素值": "",

}

""" type列固定的值，需要添加时往这里面添加"""
type_list = ["URL", "JS", "ID", "NAME", "XPATH", "CLASS", "CSS", "TAG_NAME", "LINK_TEXT", "PARTIAL_LINK_TEXT", "JS"]
